#ifndef __DXENGINECOMMON_H__
#define __DXENGINECOMMON_H__


// Exclude rarely-used stuff from Windows headers
#define WIN32_LEAN_AND_MEAN
// Enable extra D3D debugging in debug builds if using the debug DirectX runtime.  
// This makes D3D objects work well in the debugger watch window, but slows down 
// performance slightly.



#if defined(DEBUG) | defined(_DEBUG)
	#ifndef D3D_DEBUG_INFO
	#define D3D_DEBUG_INFO
	#endif
#endif
// Debug DirectX errors
#if defined(DEBUG) | defined(_DEBUG)
	#ifndef HR
	#define HR(x)										\
	{													\
		HRESULT hr = x;									\
		if(FAILED(hr))									\
		{												\
			DXTrace(__FILE__, __LINE__, hr, #x, FALSE);	\
		}												\
	}
	#endif
#else
	#ifndef HR
	#define HR(x) x;
	#endif
#endif 
// cleanup COM
#define ReleaseCOM(x) { if(x){ x->Release();x = 0; } }

#endif // __DXENGINECOMMON_H__